#include<bits/stdc++.h>
using namespace std;
const int N=100009;
vector<int> son[N];
int n,p[N],d[N];
double ans=0;
void dfs(int u,int fa){
    d[u]=d[fa]+1;
    for(int i=0;i<son[u].size();i++){
        int v=son[u][i];
        dfs(v,u);
    }
}
void input(){
    cin>>n;
    for(int u=2;u<=n;u++){
        cin>>p[u];
        son[p[u]].push_back(u);
    }
}
void solve(){
    dfs(1,0);
    for(int i=1;i<=n;i++) ans+=1./d[i];
    cout<<fixed<<setprecision(6)<<ans<<endl;
}
int main(){
    //freopen("water.in","r",stdin);
    //freopen("water.out","w",stdout);
    input();
    solve();
    return 0;
}